/*
 * @Author: your name
 * @Date: 2020-01-13 10:52:33
 * @LastEditTime : 2020-01-13 11:16:46
 * @LastEditors  : Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: /cross-bh5/vuepages/src/tools/tools.js
 */
const objDeepCopy = (source) => {
    let sourceCopy = source instanceof Array ? [] : {};
    for (let item in source) {
      if(source[item] instanceof Date){
        Date.prototype.clone=function(){
          return new Date(this.valueOf());
        }
        var date=source[item];
        var newDate=date.clone();
        sourceCopy[item] = newDate;
      }else{
        sourceCopy[item] = typeof source[item] === 'object' ? objDeepCopy(source[item]) : source[item];
      }
    }
    return sourceCopy;
};

export default{  objDeepCopy  };
